package com.hd.appcommon.entity;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class Node {
    private Long id;    //节点Id
    private String label;    //节点Id
    private Dept dept; //节点数据
    private List<Node> nodes = new ArrayList<Node>(); //多个子节点，利用List实现

    public Node(Long id){
        this.id = id;
    }

    public Node(Long id,Dept dept){
        this.id = id;
        this.dept = dept;
        this.label = dept.getName();
    }

    public Node(Long id, Dept dept, List<Node> nodes){
        this.id = id;
        this.dept = dept;
        this.nodes = nodes;
    }
}
